#include "../src_1/Stack.h"

int main() {
    Stack S;
    char m;
    cout << "各操作对应字母：" << endl;
    cout << "入栈：A  出栈：B  判断栈是否为空：C  获取栈的长度：D  清空栈：E  销毁栈：F  退出：输入其他任意字母"
         << endl;
    cout << "请输入您想进行的操作：";
    while (cin >> m) {
        if (m == 'A')
            S.Push();
        else if (m == 'B')
            S.Pop();
        else if (m == 'C') {
            if (S.IsEmpty())
                cout << "该栈为空！" << endl;
            else
                cout << "该栈不为空！" << endl;
        } else if (m == 'D') {
            cout << "该栈现有" << S.Length() << "个元素" << endl;
        } else if (m == 'E') {
            S.Clear();
            cout << "该栈已清空" << endl;
        } else if (m == 'F') {
            S.~Stack();
            cout << "该栈已销毁！" << endl;
        } else
            break;
        cout << "请输入您想进行的操作：";
    }
    cout << "已成功退出该程序！" << endl;
    return 0;
}